﻿using System;
using UnityEngine;

namespace UIFrameWork
{
    public class WindowBehaviour
    {
        public GameObject gameObject { get; set; }
        public Transform transform { get; set; }
        public Canvas canvas { get; set; }
        public string name { get; set; }
        public bool visible { get; set; }
        /// <summary>
        ///  是否是通过堆栈系统弹出的弹窗
        /// </summary>
        public bool PopStack { get; set; }
        public Action<WindowBase> PopStackListener { get; set; }

        public bool isAwake { get; private set; } = false;
        public bool needUpdate { get; protected set; } = false;
        public virtual void OnAwake() { isAwake = true; }
        public virtual void OnShow() { }
        public virtual void OnUpdate() { }
        public virtual void OnHide() { }
        public virtual void OnDestroy() { }
        public virtual void SetVisible(bool isVisible) { }
    }
}
